﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SignalR.Hubs;
using System.Threading.Tasks;
using SignalR.Hosting.AspNet;

namespace ElingOA6_Admin_DSJCJ.SignalR
{
    [HubName("chat")]
    public class Chat : Hub
    {
        public void Send(string clientName, string message)
        {
            //var toSelfinfo = "You had sent message " + message;
            //Caller.addSomeMessage(clientName, toSelfinfo);

            // Call the addMessage method on all clients

            Clients.addSomeMessage(clientName, message);

            //Clients[Context.ConnectionId].addSomeMessage(clientName, data);

            //string name = Context.User.Identity.Name;

            //foreach (var connectionId in _connections.GetConnections(clientName))
            //{
            //    Clients.Client(connectionId).addChatMessage(name + ": " + message);
            //}
        }
        
    }
}